//
//  UIImageView+MAAdv.m
//  MateAdv
//
//  Created by 茶 on 2023/9/7.
//

#import "UIImageView+MAAdv.h"

@implementation UIImageView (MAAdv)

+ (UIImageView *)initWithName:(NSString *)name {
    return [[UIImageView alloc] initWithImage:[UIImage imageNamed:name]];
}

+ (instancetype)ma_imgViewWithSuperView:(UIView *)superView imgName:(NSString *)imgName makeMasonryBlock:(void (^)(MASConstraintMaker * _Nonnull))makeMasonryBlock {
    UIImageView *imageView = [self initWithName:imgName];
    [superView addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        MABlock(makeMasonryBlock,make);
    }];
    return imageView;
}

@end
